import { IToolTip } from "../../../../../../com/mui/manager/IToolTip";
import { CrossDefenceBlessData } from "../data/CrossDefenceBlessData";
import { RuneEffectConfig } from "../../../../resource/RuneEffectConfig";
import { Language } from "../../../../../../extend/language/Language";
import { ObjCreate } from "../../../common/ObjCreate";
import { AutoLayoutTextContainer } from "../../../../../common/text/AutoLayoutTextContainer";
import { ScaleBitmap } from "../../../../../../com/mui/display/ScaleBitmap";
type int = number;
//class CrossDefenceBlessItemTips
    
    export  class CrossDefenceBlessItemTips /* flash.display.Sprite */ implements IToolTip
    {
        constructor()
        {
            
            this.initView();
            return;
        }

        public set data(arg1)
        {
            if (arg1 == null) 
            {
                return;
            }
            var loc1=arg1 as CrossDefenceBlessData;
            var loc2=RuneEffectConfig.instance.getInfoByCode(loc1.data.curId);
            var loc3=RuneEffectConfig.instance.getInfoByCode(loc1.data.nextId);
            var loc4=Language.getString(80297);
            if (loc3 == null) 
            {
                this._container.getTextByIndex(3).visible = false;
            }
            else 
            {
                loc4 = Language.getStringByParam(80329, loc3.describe);
                this._container.getTextByIndex(3).visible = true;
            }
            if (loc2 == null) 
            {
                return;
            }
            this._container.setText(0, "<font color=\'#ffff00\'>" + loc1.data.name + "</font>    Lv" + loc1.data.level);
            this._container.setText(1, Language.getStringByParam(80328, loc2.describe));
            this._container.setText(2, loc4);
            this._container.setText(3, Language.getStringByParam(80330, loc1.upgradeNeed));
            this._container.resetPosition2();
            this._bg.height = this._container.height + 20;
            return;
        }

        /* internal  */initView(): void
        {
            this._bg = ObjCreate.createBg(0, 0, CrossDefenceBlessItemTips.MyWidth, CrossDefenceBlessItemTips.MyHeight, this);
            this._container = new AutoLayoutTextContainer();
            this._container.x = 6;
            this._container.y = 6;
            this.addChild(this._container);
            this._container.addNewText(CrossDefenceBlessItemTips.MyWidth - 10, "", 15, 16776960, flash.text.TextFieldAutoSize.RIGHT, 3, null, true);
            this._container.addNewText(CrossDefenceBlessItemTips.MyWidth - 10);
            this._container.addNewText(CrossDefenceBlessItemTips.MyWidth - 10);
            this._container.addNewText(CrossDefenceBlessItemTips.MyWidth - 10);
            return;
        }

        /* internal */ static /* const */MyWidth: int=265;

        /* internal */ static /* const */MyHeight: int=180;

        /* internal */ /* var */_bg: ScaleBitmap;

        /* internal */ /* var */_container: AutoLayoutTextContainer;
    }
